package com.ruoyi.signup.controller;

import com.ruoyi.signup.service.SignUpService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.user.domain.User;

/**
 * 参赛作品上传Controller
 *
 * @author ruoyi
 * @date 2024-06-06
 */
@RestController
@RequestMapping("/singup")
public class SignUpController extends BaseController
{
    @Autowired
    private SignUpService signupService;

    /**
     * 新增账号管理
     */
    @PreAuthorize("@ss.hasPermi('signup')")
    @Log(title = "新增文件", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody User user)
    {
        return toAjax(signupService.insertUser(user));
    }

}

